﻿@model MvcImage.ViewModels.RegisterViewModel
@using MvcImage.Models
@using Bradaz.OpenSource.MVC
@using Bradaz.OpenSource.MVC.HTMLHelpers

@{
    ViewBag.Title = "Register";
}

<h2>Create a New Account</h2>
<p>
    Use the form below to create a new account. 
</p>
<p>
    Passwords are required to be a minimum of @Membership.MinRequiredPasswordLength characters in length.
</p>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm("Register", "Account", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary(true, "Account creation was unsuccessful. Please correct the errors and try again.")
    <div>
        <fieldset>
            <legend>Account Information</legend>
            <div class="editor-field">
                @Html.HiddenFor(model => model.Thumbnail)
            </div>
            <div class="editor-label">
                @Html.LabelFor(model => model.RegisterModel.UserName)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(model => model.RegisterModel.UserName)
                @Html.ValidationMessageFor(model => model.RegisterModel.UserName)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.RegisterModel.Email)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(model => model.RegisterModel.Email)
                @Html.ValidationMessageFor(model => model.RegisterModel.Email)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.RegisterModel.Password)
            </div>
            <div class="editor-field">
                @Html.PasswordFor(model => model.RegisterModel.Password)
                @Html.ValidationMessageFor(model => model.RegisterModel.Password)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.RegisterModel.ConfirmPassword)
            </div>
            <div class="editor-field">
                @Html.PasswordFor(model => model.RegisterModel.ConfirmPassword)
                @Html.ValidationMessageFor(model => model.RegisterModel.ConfirmPassword)
            </div>
            <div class="editor-label">
                @Html.Label("Avatar")
            </div>
            <div class="editor-field">
                @Html.UploadImageFor(model => model.UniqueKey,thumbnail:true)
            </div>


            <p>
                <input type="submit" value="Register" />
            </p>
        </fieldset>
    </div>
}
